.chart-labels {
  margin-bottom: 1.5em;
  font-size: 1em;
  color: var(--color-text-lightest);
  text-align: center;
}

.chart-labels label {
  padding-left: 0.5em;
  cursor: pointer;
}

.chart-labels label + label {
  border-left: 1px solid var(--color-text-lighter);
}

.chart-labels label.selected,
.chart-labels label:hover {
  color: var(--color-text-lighter);
}

.chart-mode span {
  margin-right: 0;
  color: var(--color-text);
  background-color: var(--color-background-darker);
}

.chart-mode input {
  display: none;
}

.chart-mode span:hover {
  color: var(--color-background);
}

.chart-mode input:checked + span {
  color: var(--color-background);
  background-color: var(--color-header);
}

.toggle-chart {
  height: 22px;
  padding: 2px 6px;
  margin: 0;
}

.toggle-chart::before {
  display: block;
  content: "";
  border: 0;
  border-top: 13px solid var(--color-background);
  border-right: 9px solid transparent;
  border-left: 9px solid transparent;
}

.toggle-chart.closed::before {
  border: 0;
  border-right: 9px solid transparent;
  border-bottom: 13px solid var(--color-background);
  border-left: 9px solid transparent;
}

.chart-legend {
  flex-grow: 1;
}

.chart-legend .color {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 5px;
  border-radius: 10px;
}
.chart-legend .legend {
  display: inline-block;
}

svg text {
  fill: var(--color-text-lightest);
}

svg .line {
  fill: none;
  stroke-width: 2px;
}

svg .axis path,
svg .axis line {
  fill: none;
  stroke: var(--color-chart-axis);
  shape-rendering: crispEdges;
}

svg .axis.y line {
  stroke: var(--color-chart-axis);
  stroke-dasharray: 2, 2;
}

svg.scatterplot > g,
svg.linechart > g {
  pointer-events: all;
}

svg.treemap {
  shape-rendering: crispEdges;
}

svg.treemap rect {
  stroke: var(--color-treemap-text);
  stroke-width: 2px;
}

svg.treemap text {
  cursor: pointer;
}

svg.sunburst .account {
  fill: var(--color-text);
}

svg.sunburst .balance {
  font-family: var(--font-family-monospaced);
}

svg.sunburst path {
  cursor: pointer;
}

svg.barchart .axis-group-box {
  cursor: pointer;
  opacity: 0;
}

svg.barchart .group-box {
  opacity: 0;
}

svg.barchart .group:hover .group-box {
  opacity: 0.1;
}

svg.barchart .budget {
  opacity: 0.3;
}

.tooltip {
  position: absolute;
  z-index: var(--z-index-floating-ui);
  min-width: 5em;
  padding: 0.5em;
  font-family: var(--font-family-monospaced);
  text-align: center;
  pointer-events: none;
  background: var(--color-background);
  border: 1px solid var(--color-background-darkest);
  box-shadow: 0 0 5px var(--color-background-darker);
  opacity: 0;
  transform: translate(-50%, -100%);
}

.tooltip::before {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 0;
  height: 0;
  margin-left: -15px;
  content: "";
  border: 15px solid transparent;
  border-top-color: var(--color-background-darkest);
}

.tooltip em {
  display: block;
  margin-top: 5px;
  font-family: var(--font-family);
  color: var(--color-text-lightest);
}
